import { useGetThemeById } from "@/entities/theme/model/useGetThemeById"
import ChooseLesson from "@/features/choose-lesson/ui/Choose-lesson"
import { UiHeader } from "@/shared/Uikit/UiHeader"
import { usePathname } from "next/navigation"



export default function Theme({ params }: { params: { themeId: number } }) {
    const themeId = params.themeId
    const pathname = usePathname()
    const theme = useGetThemeById(themeId)
    return (
        <>
            <div className='w-full max-h-screen overflow-hidden'>
                <UiHeader
                    title={theme.theme ? theme.theme.tittle : 'Загрузка...'}
                    backButton
                    backUrl={`${pathname?.slice(0, pathname.indexOf('theme'))}`}
                />
                <ChooseLesson themeId={themeId} />
            </div>
        </>
    )
}